<template>
	<view class="content" :style="'background:#F7F7F7;'">
		<view class="toptitle" :style="'top:0;padding-top:' + zhuangtai + 'px;height:' + (aniosgaodu+zhuangtai) + 'px;'">
			{{title}}
		</view>
		<view :style="'height:' + topgaodu + 'px;'"></view>
		<view class="list-content">
			<view class="list-item" :style="'background:#FFFFFF;'" @click="goToCreateRed(2)">
				<view class="left-text">
					<text class="text1 font30" :style="'color:#111111;'">红包抽奖</text>
					<text class="font28" :style="'color:#AEAEAE;'">奖品为现金红包，中奖可直接提现</text>
				</view>
				<view class="right-image">
					<image class="image1" src="../../../static/red_luttery.png" mode=""></image>
					<image class="image2" src="../../../static/neck-bload.png" mode=""></image>
				</view>
			</view>
			<view class="list-item" :style="'background:#FFFFFF;'" @click="goToCreateRed(1)">
				<view class="left-text">
					<text class="text1 font30" :style="'color:#111111;'">奖品码抽奖</text>
					<text class="font28" :style="'color:#AEAEAE;'">奖品为兑换码，中奖可直接兑换</text>
				</view>
				<view class="right-image">
					<image class="image1" src="../../../static/qr_icon.png" mode=""></image>
					<image class="image2" src="../../../static/neck-bload.png" mode=""></image>
				</view>
			</view>
			<view class="ad-image ">
				<ad style="height: 100%;" :unit-id="luttery_config.wx_prizedraw_banner_adv_key"></ad>
			</view>
		</view>
		<tabbar ref='tabbar'></tabbar>
	</view>
</template>

<script>
	import tabbar from '@/components/tabBar/tabBar'
	export default {
		components:{
			tabbar
		},
		data() {
			return {
				zhuangtai: 20,
				aniosgaodu: 48,
				topgaodu: 68,
				is_iphone:false,
				title:'发起抽奖	',
<<<<<<< HEAD
=======
				menu:[
					{
						id:1,
						name:'首页',
						url:'/synthesis/lutteryAssistant/luttery/index',
						url_name:'index',
						image:'../../../static/indeximage.png',
						activeImage:'../../../static/indexactive.png',
					},
					{
						id:2,
						name:'发起抽奖',
						url:'/synthesis/lutteryAssistant/startLuttery/index',
						url_name:'luttery',
						image:'../../../static/gift.png',
						activeImage:'../../../static/giftactive.png',
					},
					{
						id:3,
						name:'任务',
						url:'../../../synthesis/lutteryAssistant/index',
						url_name:'task',
						image:'../../../static/task.png',
						activeImage:'../../../static/giftactive.png',
					},
					{
						id:4,
						name:'我的',
						url:'../../../synthesis/lutteryAssistant/my/index',
						url_name:'my',
						image:'../../../static/my.png',
						activeImage:'../../../static/giftactive.png',
					},
				],
				luttery_config:''
>>>>>>> 263842a02420c7090936b7737331a37d9618b572
			};
		},
		onLoad(e) {
			this.luttery_config = uni.getStorageSync("luttery_config")
			uni.hideTabBar();
			this.createtitle();
			let pages = getCurrentPages();
			let route = pages[pages.length - 1].route;
			this.$refs['tabbar'].gettabid(route);
			// 创建签到图案
		},
		onShow() {
			if(uni.getStorageSync("token") == ""){
				uni.navigateTo({
					url:'../../../pages/login/login'
				})
			}
		},
		methods: {
			goToCreateRed(type){
				uni.navigateTo({
					url:'createLuttery?type='+type
				})
			},
			goToTab(url,url_name){
				console.log(url)
				if(url_name == "index"){
					uni.reLaunch({
						url:url
					})
				}else if(url_name == 'luttery'){
					
				}
			},
			createtitle() {
				var that = this;
				uni.getSystemInfo({
					success: function(res) {
						console.log(res);
						that.zhuangtai = res.statusBarHeight;
						var a = res.system.split(' ');
						if (a[0] == 'iOS') {
							that.aniosgaodu = 44;
							that.is_iphone = true
						} else {
							that.aniosgaodu = 48;
						}
						that.topgaodu = that.aniosgaodu + parseInt(that.zhuangtai)
					}
				});
			},
		}
	}
</script>

<style lang="scss">
	.list-content{
		width: 100%;
		padding: 30upx;
		box-sizing: border-box;
		align-items: center;
		display: flex;
		flex-direction: column;
		.list-item{
			width: 690upx;
			box-sizing: border-box;
			padding: 30upx 30upx 28upx 30upx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			border-radius: 20upx;
			margin-bottom: 30upx;
			.left-text{
				display: flex;
				flex-direction: column;
				.text1{
					margin-bottom: 20upx;
				}
			}
			.right-image{
				display: flex;
				align-items: center;
				.image1{
					width: 70upx;
					height: 70upx;
					margin-right: 20upx;
				}
				.image2{
					width: 20upx;
					height: 31upx;
				}
			}
		}
	}
	.ad-image{
		width: 690upx;
		height: 190upx;
		margin-bottom: 38upx;
		image{
			width: 100%;
			height: 100%;
		}
	}
	.content{
		display: flex;
		flex-direction: column;
		min-height: 100vh;
		align-items: center;
		width: 750upx;
		background: #F7F7F7;
		font-family: PingFang SC;
	}
	.toptitle {
		background: none;
		position: fixed;
		z-index: 98;
		width: 100%;
		display: flex;
		align-items: center;
		justify-content: center;
		height: 32px;
		color: #333;
		background: #FFFFFF;
		font-size: 36upx;
	}
	.footTabList{
		display: flex;
		align-items: center;
		justify-content: space-around;
		position: fixed;
		bottom: 0;
		left: 0;
		width: 750rpx;
		font-size: 24rpx;
		z-index: 98;
		padding-top: 12rpx;
		.listitem{
			display: flex;
			flex-direction: column;
			align-items: center;
			width: 100rpx;
			image{
				width: 42rpx;
				height: 42rpx;
				margin-bottom: 15rpx;
			}
		}
	}
</style>
